package com.nut.article.exception;

import lombok.Getter;
import lombok.Setter;
import lombok.ToString;
import org.springframework.http.HttpStatus;

/**
 * 控制层异常处理
 */
@Getter
@Setter
@ToString
public class ServiceException extends RuntimeException {

    private static final long serialVersionUID = -5048787599298669297L;

    protected HttpStatus statusCode = HttpStatus.INTERNAL_SERVER_ERROR;
    private int code;
    private String message;

    public ServiceException(String message) {
        super(message);
        this.code = -1;
        this.message = message;
    }
}
